package WrittenTest;

import java.util.Scanner;

public class test38 {
    // 统计质数
    public static boolean Prime_integer(int x) {
        int[] hash = new int[101];
        for (int i = 1; i <= 100; i++) {
            int count = 0;
            for (int j = 2; j < i; j++) {
                if (i % j == 0) {
                    count++;
                    break;
                }
            }
            if (count == 0 && i != 1) {
                hash[i]++;
            }
        }
        return hash[x] != 0;
    }
    // 字符串中出现字符最多的数量max和最少的字符min，max-min的差值如果为质数则为Lucky Word，否则No Answer
    // 算法原理：哈希表
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next().toLowerCase();
        int max = -1, min = Integer.MAX_VALUE;
        // 用数组模拟哈希表
        int[] hash = new int[26];
        // 统计出现次数最多的字符
        for (int i = 0; i < s.length(); i++) {
            char ch = s.charAt(i);
            hash[ch - 'a']++;
            if (hash[ch - 'a'] > max) {
                max = hash[ch - 'a'];
            }
        }
        // 统计出现次数最少的字符
        for (int x : hash) {
            if (x < min && x != 0) {
                min = x;
            }
        }
        // 判断max-min是否为质数
        if (Prime_integer(max - min)) {
            System.out.println("Lucky Word");
            System.out.println(max - min);
        } else {
            System.out.println("No Answer");
            System.out.println(0);
        }
    }
}
